From 9719e5fb3cfe9b025e238ec4ad04d940a98dbc90 Mon Sep 17 00:00:00 2001 From: Kristian Rietveld Date: Thu, 19 Jul 2007 15:03:18 +0000 Subject: [PATCH] handle no-window and regular widgets seperately. 2007-07-19 Kristian Rietveld * gtk/gtktooltip.c (find_topmost_widget_coords_from_event): handle no-window and regular widgets seperately. * gtk/gtktreeview.c (gkt_tree_view_set_tooltip_cell): rect.x should be zero. svn path=/trunk/; revision=18502 --- ChangeLog | 8 ++++++++ gtk/gtktooltip.c | 21 +++++++++++++++++---- gtk/gtktreeview.c | 2 +- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index f5bdd10ce5..c61fde3122 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-07-19 Kristian Rietveld + + * gtk/gtktooltip.c (find_topmost_widget_coords_from_event): handle + no-window and regular widgets seperately. + + * gtk/gtktreeview.c (gkt_tree_view_set_tooltip_cell): rect.x should + be zero. + 2007-07-19 Matthias Clasen * gtk/gtk.symbols: diff --git a/gtk/gtktooltip.c b/gtk/gtktooltip.c index c6062053ae..a79617034c 100644 --- a/gtk/gtktooltip.c +++ b/gtk/gtktooltip.c @@ -593,12 +593,25 @@ find_topmost_widget_coords_from_event (GdkEvent *event, tmp = find_widget_under_pointer (event->any.window, &tx, &ty); - /* Make sure the pointer can actually be on the widget returned */ - if (!tmp || - tx < 0 || tx >= tmp->allocation.width || - ty < 0 || ty >= tmp->allocation.height) + if (!tmp) return NULL; + /* Make sure the pointer can actually be on the widget returned */ + if (GTK_WIDGET_NO_WINDOW (tmp)) + { + if (tx < tmp->allocation.x || + tx >= tmp->allocation.x + tmp->allocation.width || + ty < tmp->allocation.y || + ty >= tmp->allocation.y + tmp->allocation.height) + return NULL; + } + else + { + if (tx < 0 || tx >= tmp->allocation.width || + ty < 0 || ty >= tmp->allocation.height) + return NULL; + } + if (x) *x = tx; if (y) diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index ad0e2a949c..42fa6f25ce 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -15274,7 +15274,7 @@ gtk_tree_view_set_tooltip_cell (GtkTreeView *tree_view, } else { - rect.x = GTK_WIDGET (tree_view)->allocation.x; + rect.x = 0; rect.width = GTK_WIDGET (tree_view)->allocation.width; } -- 2.30.2